package cn.iocoder.yudao.module.pickbook.dal.mysql.classhomework;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.pickbook.dal.dataobject.classhomework.ClassHomeworkDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.pickbook.controller.admin.classhomework.vo.*;

/**
 * 班级作业 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ClassHomeworkMapper extends BaseMapperX<ClassHomeworkDO> {

    default PageResult<ClassHomeworkDO> selectPage(ClassHomeworkPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ClassHomeworkDO>()
                .eqIfPresent(ClassHomeworkDO::getClassId, reqVO.getClassId())
                .likeIfPresent(ClassHomeworkDO::getTitle, reqVO.getTitle())
                .eqIfPresent(ClassHomeworkDO::getCreatorId, reqVO.getCreatorId())
                .orderByDesc(ClassHomeworkDO::getId));
    }

}